package pkg.andru.pattern.plugin;

/**
 * define a plugin interface, all plugin need implement this interface.
 * <p>
 * if you want to implement the plugin, will do follow steps:
 * </p>
 * <b>1.reference the jar contain this class using 'add library'</br> 2.make
 * your apk must has one activity use {@link #PLUGIN_ACTION} as it's action at
 * least </br>3.define the plugin version and plugin implement class name,
 * plugin name, and plugin description (optional), see {@link #PLUGIN_VERSION},
 * {@link #PLUGIN_CLASS_NAME}, {@link #PLUGIN_NAME}, and
 * {@link #PLUGIN_DESCRIPTION}</br></b></p>
 * 
 * @author idiottiger
 * @version 1.0.0
 */
public interface Pluginable {

    /**
     * all plugin need use this as it's action
     * 
     * @value ACTION.com.plugin.CLIENT
     */
    public static final String PLUGIN_ACTION = "ACTION.com.plugin.CLIENT";

    /**
     * the plugin version, need create in the 'res/string.xml', like:
     * <strong>&lt;string name="plugin_version"&gt; 1.0.2012 &lt;/&gt;</strong>
     * <p>
     * if not supply, will use <b>unkown</b> as the version
     * 
     * @value plugin_version
     */
    public static final String PLUGIN_VERSION = "plugin_version";

    /**
     * the plugin name, need create in the 'res/string.xml', like:
     * <strong>&lt;string name="plugin_name"&gt; PluginDemo &lt;/&gt;</strong>
     * <p>
     * if not supply, will use <b>unkown</b> as the name
     * 
     * @value plugin_name
     */
    public static final String PLUGIN_NAME = "plugin_name";

    /**
     * the plugin description, need create in the 'res/string.xml', like:
     * <strong>&lt;string name="plugin_description"&gt; Plugin Demo is a plugin
     * demo, which describe the plugin useage &lt;/&gt;</strong>
     * <p>
     * 
     * @value plugin_version
     */
    public static final String PLUGIN_DESCRIPTION = "plugin_description";

    /**
     * the plugin must tell the host which class implement the
     * {@link Pluginable} interface, need create in the 'res/string.xml', like
     * <strong>&lt;string name="plugin_full_name"&gt; com.pluginimp...
     * &lt;/&gt;</strong>
     * <p>
     * 
     * @value plugin_class_name
     */
    public static final String PLUGIN_CLASS_NAME = "plugin_class_name";

    /**
     * actually plugin do something
     */
    public void pluginDo();
}
